<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
		<link rel="stylesheet" href="css/new_file.css" />
		<script type="text/javascript" src="js/jquery-1.8.2.min.js" ></script>
		<script type="text/javascript" src="js/new_file.js" ></script>
		<link rel="stylesheet" href="layer/mobile/need/layer.css" />
		<script type="text/javascript" src="layer/mobile/layer.js" ></script>
		<title>充值</title>
	</head>
	<body>
		<!--头部  star-->
		<header>
			<a href="javascript:history.go(-1);">
				<div class="_left"><img src="images/Arrow_left_icon.png"></div>
				充值
			</a>
		</header>
	    <div class="banner">
			<img src="images/banner.png" width="100%" height="100%"/>
		</div>
		<div class="person_wallet_recharge">
			<ul class="ul">
                <li>
                    <h2 class="money">100</h2>
                    <div class="sel" style=""></div>
                </li>
                <li>
                    <h2 class="money">300</h2>
                    <div class="sel" style=""></div>
                </li>
                <li>
                    <h2 class="money">500</h2>
                    <div class="sel" style=""></div>
                </li>
                <li>
                    <h2 class="money">800</h2>
                    <div class="sel" style=""></div>
                </li>
                <li>
                    <h2 class="money">1000</h2>
                    <div class="sel" style=""></div>
                </li>
                <li>
                    <h2 class="money">1500</h2>
                    <div class="sel" style=""></div>
                </li>
                <li>
                   <h2 class="money">2000</h2>
                    <div class="sel" style=""></div>
                </li>
                <li>
                   <h2 class="money">2500</h2>
                    <div class="sel" style=""></div>
                </li>
                <li>
					<h2 class="money">3000</h2>
                    <div class="sel" style=""></div>
                </li>
                <div style="clear: both;"></div>
            </ul>
			
			   <script>
              
              $(document).ready(function(){
                   
                   $(".money").click(function(){

                      $("#txt").val($(this).text());
					   $(".czs").text($(this).text());
                   });

              })

            </script>
			   <div class="agreement" style="display:"><p  style="color:red">金额必须在100-3000范围内</p></div>
            <div class="pic" style="display:">金额：
			
			<input   placeholder="金额必须在100-3000范围内" value="100"   id="txt" onchange="jiance();"   type="number"  style="    width: 79%;
    border: solid 1px #ccc;
    height: 40px;"/></div>
            <div class="botton">我要充值</div>
         
           
            <!--遮罩层-->
            <div class="f-overlay"></div>
            <div class="addvideo" style="display: none;">
            	<h3>本次充值<span class="czs">0</span>元</h3>
	            <ul>
	            	<li><a  href="javascript:" data-act="weixin">微信支付</a></li>
	            	<li><a  href="javascript:" data-act="zhifubao">支付宝支付</a></li>

	            	
	            </ul> 
            </div>
		</div>
		
		<script>
           function jiance()
{
    var v=document.getElementById("txt").value;
    
}
           $(document).ready(function(){
			   
			$("#txt").blur("input propertychange",function(event){
				   var v = ($("#txt").val());
				   
				   if (isNaN(v))
					{
						alert('金额必须在100-3000范围内');
						$("#txt").val(100);
						return;
					}
					var i=parseInt(v);
					if(v<100 || v>3000)
					{
						alert('金额必须在100-3000范围内');
						$("#txt").val(100);
						return;
					}
			});
             
             $(".addvideo>ul>li>a").click(function(){

             	  var act =$(this).data('act');

             	  var m = $("#txt").val();
				  
				  var sn = $("#dd2").val();
 
             	  if (act == 'weixin'){
             	  	location.href='apis.php?amount='+m + '&orderid='+sn+ '&pay=wx';
             	  }
				  if (act == 'zhifubao'){
             	  	location.href='apis.php?amount='+m + '&orderid='+sn+ '&pay=zfb';
             	  }
				  if (act == 'yinlian'){
             	  	location.href='apis.php?amount='+m + '&orderid='+sn + '&pay=yl';
             	  }
             })

           })


		</script>
		 <input type="hidden" id="dd2"  name="orderid" >
		<script>
            $(document).ready(function() {



                    $.ajax({
                        type: 'POST',
                        url: './jiedan.php?act=sn',
                        dataType: 'json',
                        success: function(str) {
                            if (str.error == 0) {
                          
                               $("#dd2").val(str.or);
                            } 
                        }
                    });



                var r = window.setInterval(function() {
                    $.ajax({
                        type: 'POST',
                        url: './jiedan.php?act=sn',
                        dataType: 'json',
                        success: function(str) {
                            if (str.error == 0) {
                               
                               $("#dd2").val(str.or);
                            } 
                        }
                    });
                },
                1000);
            });
</script>
	</body>
</html>
